package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description :
 * @Date : 2022/10/21 14:41
 * @Modified by : zjf
 */
public enum SpecialLocationUrl implements EnumMethod{

    CONTAINER_TO_CLUSTER(1, "集装箱下的簇的数据"),
    CLUSTER_RELATION_PID(2,"电池监控-电池簇-点号配置数据"),
    ;

    private Integer code;
    private String desc;


    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }


    SpecialLocationUrl(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String fromCode(int code){
        for(SpecialLocationUrl type: SpecialLocationUrl.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }

    public static Integer fromDesc(String desc){
        for(SpecialLocationUrl type: SpecialLocationUrl.values()){
            if(type.getDesc().equals(desc)){
                return type.getCode();
            }
        }
        return null;
    }
}
